package com.ly.mpayment.persist.service.yidong;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSONObject;
import com.ly.mpayment.persist.entity.UpOrder;
import com.ly.mpayment.persist.entity.yidong.GameOrder;
import com.ly.mpayment.persist.entity.yidong.MobileOrders;
import com.ly.mpayment.persist.hibernate.Page;

public interface IMobileOrdersService {

	public Page<MobileOrders> pageOrders(Map<String, Object> parameters ,int start,int pageSize);
	
	public boolean saveMobileOrders(MobileOrders pool);
	
	public boolean updateMobileOrders(MobileOrders pool,String msg);
	
	public boolean updateMobileOrders(MobileOrders pool);
	
	public GameOrder updateMobileOrdersGame(MobileOrders mobilesOrder,JSONObject json,GameOrder order,String type);
	
	public MobileOrders findByNumberId(String numberId);
	
	public MobileOrders findById(String id);
	
	public MobileOrders findByFailtId(String id);
	
	public MobileOrders findBySuccessId(String id);
	
	public MobileOrders findBySuccessYiDongId(String id);

	public MobileOrders findByOrderId(String id);
	
	public MobileOrders findByTeleOrderId(String id);
	
	public MobileOrders findByFetchNumberPool(String id);
	
	/**
	 * 查询未完成的订单
	 * @param phoneNum
	 * @return
	 */
	public List<MobileOrders> findMonthNotEnd(String phoneNum,int orderStatus,int operator);
	
	public List<MobileOrders> findNoticeStatus(int matching,int orderStatus,int operator);
	
	public MobileOrders findRechargeStatusPrice(int orderStatus,BigDecimal chargeMoney,int type,String payType);
	
	/**
	 * 查询所有为0的订单 检查是否超时 如果超时则直接失败返回
	 * @param orderStatus
	 * @return
	 */
	public List<MobileOrders> findRechargeStatusPrice(int orderStatus);
	
	
	/**
	 * 查询没有匹配 并且订单状态为空的 订单时间大于1.40之外的订单
	 * @param orderStatus
	 * @param matching
	 * @return
	 */
	public List<MobileOrders> findNotMatching(int orderStatus,int matching);
	
	/**
	 * 查询未下单成功 未匹配的订单超时自动失败
	 * @param orderStatus
	 * @param matching
	 * @return
	 */
	public List<MobileOrders> findNotMatchingOrder(int orderStatus, int matching);
	
	/**
	 * 查询匹配成功 支付超时的订单
	 * @param orderStatus
	 * @param matching
	 * @return
	 */
	public List<MobileOrders> findMatchingOrder(int orderStatus,int matching);
	
	
	/**
	 * 失败订单 订单状态 1 未支付 0 等待支付 2支付成功 3支付失败 4充值成功 5充值失败
	 * 
	 * @param numberPoolId
	 * @param mobileOrdersId
	 * @param order
	 * @param msg
	 * @param bool
	 *            是否通知游戏 true 通知 false 为不通知，正常流程失败需要通知， 下单失败或者二维码获取失败不需要通知
	 */
//	public void failtMobileOrder(String mobileOrdersId, UpOrder order, String msg, String orderStatus,boolean temp) ;
	
	/**
	 * 手动失败订单调用
	 * @param mobileOrdersId
	 * @param order
	 * @param msg
	 * @param orderStatus
	 * @param temp
	 */
//	public void failtHandlerMobileOrder(String mobileOrdersId, UpOrder order, String msg, String orderStatus,boolean temp);
//	
//	public void failtMobileOrderError(String mobileOrdersId, UpOrder order, String msg, String orderStatus,boolean temp);
//
//	public void failtMobileOrderMatch(String mobileOrdersId, UpOrder order, String msg, String orderStatus,boolean temp);
	
//	public void updateGameOrderNotNotice(MobileOrders mobileOrder, String orderStatus,boolean temp,String msg);
	
//	public void successMobileOrder(String mobileOrdersId, UpOrder order, String msg, String orderStatus,String paySuccess);
	
//	public void updateGameOrder(MobileOrders mobileOrder, String orderStatus,String msg);
}
